Skip to content

Conversation

@umidjon-2231
Copy link
Contributor

Summary:
This pull request introduces enhancements to the mcp-graphql project, enabling support for GraphQL schema files hosted at URLs. The changes include updates to the README documentation and modifications to the introspection logic to accommodate schema files accessible via HTTP/HTTPS URLs.

Changes Made:

  1. README Updates:

    • Clarified that the SCHEMA environment variable can now accept a URL in addition to a local file path.
    • Added examples demonstrating how to use schema files hosted at URLs.
  2. Code Enhancements:

    • Added a new helper function introspectSchemaFromUrl in introspection.ts to fetch and process schema files hosted at URLs.
    • Updated the introspectLocalSchema function to ensure consistent formatting.
    • Modified index.ts to integrate the new logic for handling schema files hosted at URLs. The server now checks if the SCHEMA variable is a URL and uses the appropriate introspection method.
  3. Error Handling:

    • Improved error messages for failed schema fetch operations, providing more context for debugging.

Testing:

  • Verified the functionality with both local schema files and schema files hosted at URLs.
  • Ensured backward compatibility with existing introspection logic.

Impact:
These changes enhance the flexibility of the mcp-graphql server, allowing users to work with schema files hosted remotely, which is particularly useful for distributed environments or when schema files are managed externally.

Issue Reference:
No specific issue linked.

Reviewer Notes:

  • Please verify the updated README for clarity and completeness.
  • Ensure the new introspection logic handles edge cases, such as invalid URLs or inaccessible schema files.

Additional Context:
This update aligns with the project's goal of providing robust and flexible GraphQL tooling for diverse use cases.

@blurrah blurrah merged commit cfcec60 into blurrah:main Jul 31, 2025
2 checks passed
@blurrah
Copy link
Owner

blurrah commented Jul 31, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants